using System.Configuration;
using System.Xml;

namespace FormsGenerator.DataAccess
{
	/// <summary>
	/// //TODO: implement!
	/// </summary>
	public class DataAccessConfigurationHandler: IConfigurationSectionHandler
	{		
		public object Create(object parent, object configContext, XmlNode section)
		{
            foreach (XmlNode element in section.ChildNodes)
            {
                if (element.NodeType != XmlNodeType.Comment )
                {
                    return element.Attributes["value"].Value;                 
                }
            }
            throw new FormsGeneratorException.ConfigurationException("There are no handlers defined in the DBHandler section in web.config. Please add a handler!");
             
		}
	}
}
